import api from './index'
import {axios} from '@/utils/request'

export function collection() {
  return axios({
    url: '/remoteData/weatherData/queryWeatherData',
    method: 'get'
  })
}

//设备管理-阀门列表查询
export function pageList(devName, pageNo, pageSize) {
  return axios({
    url: `/fabr/fabrDevice/valvePageList?devName=${devName}&pageNo=${pageNo}&pageSize=${pageSize}`,
    method: 'get'
  })
}


export function groupList() {
  return axios({
    url: `/fabr/fabrIrrigationGroup/list`,
    method: 'get'
  })
}

export function deviceList() {
  return axios({
    url: `/fabr/fabrDevice/valveList?devName=`,
    method: 'get'
  })
}

export function irrigationGroup(parameter) {
  return axios({
    url: `/fabr/fabrIrrigationGroup/add`,
    method: 'post',
    data: parameter
  })
}

export function single(parameter) {
  return axios({
    url: `/fabr/fabrIrrigationGroup/delete?id=${parameter}`,
    method: 'delete'
  })
}

//计划轮罐组记录-批量删除
export function all(parameter) {
  return axios({
    url: `/fabr/fabrIrrigationGroup/deleteBatch?ids=${parameter}`,
    method: 'delete'
  })
}

export function editListall(parameter) {
  return axios({
    url: `/fabr/fabrIrrigationGroup/queryById?id=${parameter}`,
    method: 'get',

  })
}

export function edit(parameter) {
  return axios({
    url: `/fabr/fabrIrrigationGroup/edit`,
    method: 'put',
    data: parameter
  })
}

export function statusChange(parameter) {
  return axios({
    url: `/aliyun/irrigationGroup/statusChange?ids=${parameter.ids}&isBind=${parameter.isBind}`,
    method: 'get',
    data: parameter
  })
}

// 轮灌组数据
export function irrigationGroupLists() {
  return axios({
    url: `/fabr/fabrIrrigationGroup/queryGroupList`,
    method: 'get',
  })
}

//气象数据对接-分页列表查询
export function list(pageNo, pageSize) {
  return axios({
    url: `/fabr/fabrWeather/list?pageNo=${pageNo}&pageSize=${pageSize}`,
    method: 'get',
  })
}


//需水量监测-分页列表查询
export function hspWeather(pageNo, pageSize) {
  return axios({
    url: `/aliyun/hspNeedwater/list?pageNo=${pageNo}&pageSize=${pageSize}`,
    method: 'get',
  })
}

//水肥浓度监测-分页列表查询
export function hspConcentration(pageNo, pageSize) {
  return axios({
    url: `/aliyun/hspConcentration/list?pageNo=${pageNo}&pageSize=${pageSize}`,
    method: 'get',
  })
}

//打印
export function exportXls(url) {
  return axios({
    url: url,
    method: 'get',
    responseType: 'blob'
  })
}